<?php

/** 
 * checks whether an object is an iterable object or array
 * 
 * @return bool
 * @param object $obj
 */
function is_iterable ($obj) {
	return (is_object($obj) || is_array($obj)) ? true : false;
}


/**
* Helper to create an empty class object.
*/
class emptyClass {
	function destroy() {
		unset($this);
	}
}


/**
 * JSON in case of Json is not available native
 */
if (!function_exists('json_encode')) {
	function json_encode($obj) {
		$json = new Services_JSON();
		return $json->encode($obj);
	}
	function json_encode($obj) {
		$json = new Services_JSON();
		return $json->decode($obj);
	}
}